{% extends 'base_main.html' %}
{% load static %}
{% block ext_css %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'axf/main/css/market.css' %}">
    <link rel="stylesheet" href="{% static 'css/swiper.css' %}">
{% endblock %}

{#{% block footer %}#}
{#    {{ block.super }}#}
{#{% endblock %}#}

{% block ext_js %}
    <script type="text/javascript" src="{% static 'js/swiper.jquery.js' %}"></script>
    <script type="text/javascript" src="{% static 'axf/main/js/market.js' %}"></script>
{% endblock %}

{% block content %}
    <div id="market">
        {#    左侧导航#}
        <aside>
            <ul>
                {% for food in foodtypes %}

                    <li>
                        {#                        <span class="yellowSlide"></span>#}
                        <a id="first_menu"
                           href="{% url 'app:market' %}?typeid={{ food.typeid }} ">{{ food.typename }}</a>
                        {% ifequal food.typeid typeid %}
                            <span class="yellowSlide"></span>
                        {% endifequal %}
                    </li>

                {% endfor %}


            </ul>

        </aside>
        {#    顶部导航#}
        <nav>
            <ul>
                <li>
            <span id="all_type">
                全部分类 &nbsp;
                <span class="glyphicon glyphicon-chevron-down"></span>
            </span>
                </li>
                <li>
            <span id="all_sort">
                综合排序&nbsp;
                <span class="glyphicon glyphicon-chevron-down"></span>
            </span>
                </li>
            </ul>
        </nav>
        {#    右侧数据#}
        <section>

            <menu>
                <ul>

                    {% for good in goods %}

                        <li>
                            <div class="shoppingInfo">
                                <h6>{{ good.productlongname }}</h6>

                                <p class="detailTag">
                                    <span>精选</span>
                                    <span></span>
                                </p>
                                {{ good.specifics }}
                                <p class="price">
                                    <span>{{ good.price }}</span>
                                    <s>{{ good.marketprice }}</s>
                                </p>
                            </div>

                            <section class="subShopping">

                                <button class="decGoods" id="{{ good.id }}">-</button>


                                {% if good in goods_list %}
{#                                     {% for cart in carts %}#}
{#                                    <span>{{ carts}}.filter(c_good=good).first.c_goods_num</span>#}
                                    <span>{{ good.cart_set.first.c_goods_num }}</span>
{#                                     {% endfor %}#}
                                    {% else %}
                                    <span>0</span>

                                {% endif %}
{#                                <span>0</span>#}

                                <button goodsid="{{ good.id }}" class="addGoods">+</button>
                            </section>
                            <a href="">
                                <img src="{{ good.productimg }}">
                            </a>
                        </li>
                    {% endfor %}
                </ul>
                <div id="second_menu01" style="display: none">
                    <div>
                        {% for ch in ch_list %}
                            {% ifequal ch.1 childcid %}
                                <a href="{% url 'app:market' %}?typeid={{ typeid }}&childcid={{ ch.1 }}">
                                    <button class="btn-success">{{ ch.0 }}</button>
                                </a>
                            {% else %}
                                <a href="{% url 'app:market' %}?typeid={{ typeid }}&childcid={{ ch.1 }}">
                                    <button class="btn-danger">{{ ch.0 }}</button>
                                </a>
                            {% endifequal %}
                        {% endfor %}
                    </div>

                </div>
                <div id="second_menu02" style="display: none">
                    <div>
                        {% for sort in sort_list %}
                            {% ifequal sort sortby %}
                                <a href="{% url 'app:market' %}?typeid={{ typeid }}&childcid={{ childcid }}&sortby={{ sort }}">
                                <button class="btn-success">{{ sort }}</button>
                                </a>

                            {% else %}
                                <a href="{% url 'app:market' %}?typeid={{ typeid }}&childcid={{ childcid }}&sortby={{ sort }}">
                                <button class="btn-danger">{{ sort }}</button>
                                </a>
                            {% endifequal %}
                        {% endfor %}

                    </div>
                </div>
            </menu>
        </section>
    </div>

{% endblock %}